package com.mobile.struts.action;

import org.apache.struts.actions.DispatchAction;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

public class BaseDispatchAction extends DispatchAction {
	
	public WebApplicationContext getWac() {
		WebApplicationContext wac =
			   WebApplicationContextUtils.getRequiredWebApplicationContext(servlet.getServletContext());
		return wac;
	}
	/**
	 * 获取业务类
	 * @param name	spring中的beanid
	 * @return
	 */
	public Object getBean(String name){
		return this.getWac().getBean(name);
	}
}
